#!/bin/bash
current_date=$(date +%Y-%m-%d)
current_time=$(date +%H:%M:%S)
echo "服务器信息-$current_date $current_time"
echo -e "\n"

while IFS= read -r ip; do
    ip_arry+=("$ip")
done <servers.txt

for ip in "${ip_arry[@]}"; do
    echo "${ip}"
    ssh -o StrictHostKeyChecking=no "$ip" 'bash -s' <./getServerInfo.sh
    echo
done
